#include <iostream>
#include <map>
#include <string>
#include "ScreenManager.h"
#include <cassert>
#include "IScreen.h"

using namespace std;

IScreen * ScreenManager::getActiveScreen(){
    return mActiveScreen;
}

int ScreenManager::getActiveScreenID() {
    int i = 0;
    for(; i < 3; i++) {
        if(mActiveScreen == mScreens[i]) {
            return i;
        }
    }
    return -1;
}

int ScreenManager::setActiveScreen(int id) {
//    clear_to_color(screen, makecol(255, 255, 255)); //to make it white

    if(id > 2 || id < 0) {
        return -1;
    }
    else {
        mActiveScreen = mScreens[id];
        return 0;
    }
}

int ScreenManager::addScreen(int id, IScreen * screen){
    assert(id < 3 && id > -1);
    mScreens[id] = screen;
    if(mActiveScreen == NULL)
        mActiveScreen = screen;
    return 0;
}

